prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datarootdir = ${prefix}/share
sdlappdatadir = $(datarootdir)/logstalgia/
sdlappfontdir = 

CXX = g++
CC = gcc
objects = sdlapp.o display.o extensions.o fxfont.o logger.o regex.o resource.o stringhash.o texture.o frustum.o camera.o plane.o quadtree.o seeklog.o
CPPFLAGS =  -D_THREAD_SAFE  -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include -I/opt/local/include/FTGL -I/opt/local/include/freetype2  
CXXFLAGS = -g -O2

ifdef sdlappdatadir
CPPFLAGS += -DSDLAPP_RESOURCE_DIR=\"$(sdlappdatadir)\"
endif

ifdef sdlappfontdir
CPPFLAGS += -DSDLAPP_FONT_DIR=\"$(sdlappfontdir)/\"
endif

all:	$(objects)

distclean:
	rm Makefile

clean:
	rm -f *.o *.d

%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

ifndef NODEPS
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
dfiles = $(patsubst %.o,%.d,$(objects))
%.d: %.cpp
	$(CXX) $(CXXFLAGS) $< -o $@ -MT $(patsubst %.cpp,%.o,$<) -MM $(CPPFLAGS)
-include $(dfiles)
endif
endif # NODEPS
